package com.chenjt.three_tools;

import dev.langchain4j.model.chat.ChatLanguageModel;
import dev.langchain4j.model.openai.OpenAiChatModel;

/**
 * 注释：
 *
 * @author chenjt
 * @date 2025/3/6 16:01
 */
public class ModelUtil {

//    public static String API_KEY = "sk-xxxxx";
    public static String API_KEY = "sk-xxxxx";

//    public static String BASE_URL = "https://api.openai.com/v1";
    public static String BASE_URL = "https://api.openai-proxy.org/v1";


    /**
     * 获取openai的聊天语言模型
     * @return
     */
    public static ChatLanguageModel getOpenAIChatModel(){
        ChatLanguageModel model = OpenAiChatModel.builder()
                .apiKey(ModelUtil.API_KEY)
                .baseUrl(ModelUtil.BASE_URL)
                .modelName("gpt-4o-mini")
                .build();
        return model;
    }


}
